package com.ylsdxy.menu.service.impl;



import com.ylsdxy.menu.entity.FirstMenu;
import com.ylsdxy.menu.mapper.MenuMapper;
import com.ylsdxy.menu.service.MenuService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MenuServiceImpl implements MenuService {
    @Resource
    MenuMapper menuMapper;


    @Override
    public List<FirstMenu> getMenuInfo() {
        List<FirstMenu> firstMenus= menuMapper.getFirstMenu();
        for (FirstMenu firstMenu : firstMenus) {
            firstMenu.setSecondMenus(menuMapper.getSecondMenu(firstMenu.getId()));
        }
        return firstMenus;
    }
}
